Problem with inactive(Button) and addMenu

Hello every one,

 

I recently encountered an interesting problem which I can't solve on my own mostly because I don't understand why this error is happening in the first place.

I've build a window which contains a menu, somtehing like "File Edit Help" which you can find on the top of the main doors window too.

And now I wanted to set some buttons inacive but I only encountered the error message: "incorrectly concatenated tokens" at the same line as the call.

This message confued me and I tried to build my code up again. I started with only the buttons which I successfully managed set inactive,

but at the point where I added the menu bars the same error message as above appeared  and leaved me confused again.

 

So why can't I inactivate Buttons when menu bars are added?

And activate() seems to work.

 

Code examples below:

 

The Code snipp which doesn't work:

DB menuDemo = create("Menu Demo", styleCentered|styleFloating|styleThemed|styleFixed)
DBE theTab = null;
DBE continue_Btn = null;
DBE display_Btn

DBE mb

const string tabStrings[] = {"Signal Data", "Feature Modules"}
const string infoText_Str = "placeholder"
const string helpText_Str = "M:\\Sydow\\addins\\DXL\\Scripts\\Signal Data Check\\Documentation\\Check Definition.xlsx"
const string helpLabel_Str = "Tipp: Coppy the above string into your clipporad and paste it into the Windows explorer to open the File"
//Varaibles for Banner "Help"
string entries_H[] = {"Manual Path"}

char alt_buttons_H[] = {'M'}

char hotKey_H[] = {'M'}

string help_H[] = {"displays path for the Script Manual"}

string inactive[]= {"Never"}

//Variables for Banner "Info"
string entries_I[] = {"short description"}

char alt_buttons_I[] = {'D'}

char hotKey_I[] = {'D'}

string help_I[] = {"displays short description"}


Sensitivity sensitive(int index) 
{
        return ddbAvailable//only

}


void cb_H(int index) 
{

}


void cb_I(int index)
{

}

void tabCb(DBE xx) {
        int tabNum = get xx
        tabNum_Global = tabNum;
        print tabNum

        if (tabNum == 0)
        {
                //show theFrame

                show continue_Btn ;
        }
        else if(tabNum == 1)
        {
                show continue_Btn;

        }
}

void checkManagement(DBE btn)
{
        inactive(btn);
        //incorrectly concatenated tokens
}

void displayLog(DBE btn)
{
        inactive(btn)
        //incorrectly concatenated tokens
}

theTab = tab(menuDemo, tabStrings, 313, 198, tabCb)
continue_Btn = button(menuDemo, "Continue", checkManagement, true)
display_Btn = button(menuDemo, "Display Log", displayLog, true)

mb = menuBar(menuDemo);

addMenu(mb, "Help", 'H', entries_H, alt_buttons_H, hotKey_H, help_H, inactive, sensitive, cb_H)
addMenu(mb, "Info", 'I', entries_I, alt_buttons_I, hotKey_I, help_I, inactive, sensitive, cb_I)

continue_Btn -> "left" -> "form"
continue_Btn -> "top" -> "inside" -> theTab;
continue_Btn -> "right" -> "unattached"

display_Btn -> "left" -> "spaced" -> continue_Btn;
display_Btn -> "top" -> "aligned" -> continue_Btn;
display_Btn -> "right" -> "inside" -> theTab



realize(menuDemo)
show menuDemo

 

And now the code which is working:

DB menuDemo = create("Menu Demo", styleCentered|styleFloating|styleThemed|styleFixed)
DBE theTab = null;
DBE continue_Btn = null;
DBE display_Btn

DBE mb

const string tabStrings[] = {"Signal Data", "Feature Modules"}
const string infoText_Str = "placeholder"
const string helpText_Str = "M:\\Sydow\\addins\\DXL\\Scripts\\Signal Data Check\\Documentation\\Check Definition.xlsx"
const string helpLabel_Str = "Tipp: Coppy the above string into your clipporad and paste it into the Windows explorer to open the File"
//Varaibles for Banner "Help"




Sensitivity sensitive(int index) 
{
        return ddbAvailable//only

}


void cb_H(int index) 
{

}


void cb_I(int index)
{

}

void tabCb(DBE xx) {
        int tabNum = get xx
        tabNum_Global = tabNum;
        print tabNum

        if (tabNum == 0)
        {
                //show theFrame

                show continue_Btn ;
        }
        else if(tabNum == 1)
        {
                show continue_Btn;

        }
}

void checkManagement(DBE btn)
{
        inactive(btn);
}

void displayLog(DBE btn)
{
        inactive(btn)
}

theTab = tab(menuDemo, tabStrings, 313, 198, tabCb)
continue_Btn = button(menuDemo, "Continue", checkManagement, true)
display_Btn = button(menuDemo, "Display Log", displayLog, true)

mb = menuBar(menuDemo);


continue_Btn -> "left" -> "form"
continue_Btn -> "top" -> "inside" -> theTab;
continue_Btn -> "right" -> "unattached"


display_Btn -> "left" -> "spaced" -> continue_Btn;
display_Btn -> "top" -> "aligned" -> continue_Btn;
display_Btn -> "right" -> "inside" -> theTab



realize(menuDemo)
show menuDemo

Here you can see that if I delete the addMenu functions and the string Arrays the code is working.

 

I hope this does make sense for someone.

And thank you in advance

 

Best wishes,

Patrick

 


Patrick_1 - Wed Mar 06 07:49:03 EST 2019

Re: Problem with inactive(Button) and addMenu
O.Wilkop - Wed Mar 06 10:13:58 EST 2019

I would assume that the string array called "inactive" and the function called "inactive" is confusing DOORS. Try renaming the string array to something else and see if that changes anything.

Re: Problem with inactive(Button) and addMenu
Patrick_1 - Mon Mar 18 07:43:00 EDT 2019

Thank you for your reply.

Youa are absoluetly right, I overlooked the string array which is confusing doors.